//商家搜索
let express = require('express');
let path = require('path');
//引入自定义模块
let user = require('../model/user');
let menu = require('../model/menu');
let sea = require('../model/sea');

var router = express.Router();


router.get('/',function(req,res,next){
    res.sendStatus(404);
    //_dirname:当前文件的路径，path.join():合并路径
});
/**
 *登录验证功能
 */
router.post('/',function (req,res,next){
    let searchText = req.body.searchText;
    sea.search(searchText,function (arr){
        if(arr.length === 0){
            res.send({sellerListStatus:1});
        }
        else {
            res.send(JSON.parse('{"sellerListStatus":0,"sellerList":['+arr+']}'));
        }
    })
})
module.exports = router;